package com.felight;

import java.util.ArrayList;

public class comparator {
	public static void main(String[] Feliight){
		ArrayList<Employee> empList = new ArrayList<Employee>();
		empList.add(new Employee(10, "Jack Sparrow", "pirates of the caribbean"));
		empList.add(new Employee(11, "Boramir", "LOTR"));
		empList.add(new Employee(12, "Frodo Baggins", "LOTR"));
		empList.add(new Employee(13, "Gandalf", "LOTR"));
		empList.add(new Employee(16, "Legolas Greenleaf", "LOTR"));
		System.out.println("unsorted: "+ empList);
	    Collections.sort(empList);
	    System.out.println("sortted:" + empList);
	    AddressSort addressSort = new AddressSort();
	    Collections.sort(empList,addressSort);
	    System.out.println("Sorted by address using Comparator:\n" + empList );
	}

}
